package com.zmj.solr.service;

import com.alibaba.fastjson.JSONObject;
import com.zmj.solr.vo.SolrProduct;
import com.zmj.solr.vo.SuggestConf;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import java.io.File;
import java.util.List;
import java.util.Map;

public interface IsolrService {

    Map<String, Object> query(Map map);

    int addIndex(SolrProduct item);

    int deleteAll();

    int deleteById(String id);

    int createIndex();

    JSONObject suggest(String search);

    int buildSuggestConf();

    /**
     * 更改suggest dict.txt文件内容 是否追加
     *
     * @param confs
     * @param append
     * @param updateBy
     * @return
     */
    int writeSuggestConf(List<SuggestConf> confs, boolean append,String updateBy);

    int writeSuggestConfFile(File tempFile, CommonsMultipartFile requestFile, boolean append,String updateBy);
}
